/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package by.vdl.websort.server.dao.rowmapper;

import by.vdl.websort.server.entity.CategoryDTO;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 *
 * @author zeor
 */
public class CategoryRowMapper implements RowMapper<CategoryDTO>{

    public CategoryDTO mapRow(ResultSet rs, int i) throws SQLException {
        CategoryDTO categoryDTO = new CategoryDTO();
        categoryDTO.setId(rs.getLong("id"));
        categoryDTO.setName(rs.getString("name"));
        categoryDTO.setStudyId(rs.getLong("study_id"));
        
        return categoryDTO;
    }
    
}
